@echo off

echo --- Start post-build steps ---
cd
IF NOT EXIST ..\Voca\bin GOTO FINISH
RMDIR /S /Q ..\Voca\bin

:FINISH
echo STEP - Create bin directory
mkdir ..\Voca\bin
echo STEP - Copy executable
copy /Y release\Voca.exe ..\Voca\bin

cd ..\Voca\bin\

copy /Y ..\DLL\*.dll
mkdir Sounds
copy /Y ..\Sounds Sounds

echo STEP - Create zipfile with all required files
start /WAIT "create_ZIP" "D:\Programmes\Systeme\Winrar\WinRAR.exe" a -afzip Voca.zip Voca.exe *.dll Sounds/*

echo STEP - clear files
DEL /Q /S *.exe *.dll
RMDIR /S /Q Sounds

rem echo STEP - Commit version
rem hg commit --verbose --user Sousou --message=VOCA:Nouvelle_Version_v_0.1 -- bin/Voca.zip
rem hg tag --rev " + revision + " --user Sousou --message=Release_Version_v_0.1
    
echo --- End post-build steps ---

exit
